<template>
  <!--礼品卡页面-->
  <div class="lipin">
    <swiper :imgList="imgList"></swiper>
    <wv-panel>
      <wv-media-box v-for="item in giftCardList" :key="item.goodsId" :thumb="item.coverImg | imgPathFilter" :title="item.goodsName" :description="item.goodsPrice +'元'"  :to="{path:'/jinkadetail',query:{goodsId:item.goodsId}}"/>
    </wv-panel>
  </div>
</template>

<script type="text/ecmascript-6">
  import swiper from '../offertemplate/imgswipertemplate'
  import {giftVipcard} from '../../../test/unit/http'
  export default {
    name: 'lipinka',
    props: {},
    data() {
      return {
        imgList: [],
        giftCardList: [],
        config: {}
      };
    },
    methods: {
      buy(){
        this.$router.push({path: '/guibintongdao'})
      }
    },
    created() {
      giftVipcard({}).then(res => {
          var that =this;
        if (res.code == 100) {
          console.log('礼品卡数据  ' + JSON.stringify(res.object));
          that.giftCardList = res.object.giftVipcardList;
          that.config = res.object.config;
          var configImg=res.object.config.configImg;
          var isEmpty = this.$myUtils.isNull(configImg);
          if (!isEmpty) {
            that.imgList = configImg.split(",");
          }
          console.log('礼品卡赋值完成  ' + that.giftCardList)
        }
      })
    },
    components: {
      swiper
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less" rel="stylesheet/less">

</style>
